<template>
  <base-dialog  title="用户角色"  v-bind="$attrs" v-on="$listeners" :is-view="true" width="600">
    <el-table :data="list" stripe size="small" width="100%" height="400">
      <el-table-column align="left" prop="id" label="id"> </el-table-column>
      <el-table-column align="left" prop="name" label="角色名">
      </el-table-column>
    </el-table>
  </base-dialog>
</template>
<script>
  import user from "@/api/systemManagement/user/index";
  import BaseDialog from '@/components/Common/BaseDialog'
export default {
  components: { BaseDialog },
  props: {
    id: {
      type: Number,
      required: true
    }
  },
  name: "RoleListDialog",
  data() {
    return {
      list: []
    };
  },
  created() {
    this.getRoleUser();
  },
  methods: {
    getRoleUser() {
      user.getUsersRoles(this.id).then(res => {
        this.list = res.data.value;
      });
    },
    handleClose() {
      this.$emit("update:visible", false);
    }
  }
};
</script>
